package com.focus.pay.core.client;

import com.focus.pay.core.action.PayOrderAction;
import com.focus.pay.core.action.PayNoticeAction;
import com.focus.pay.core.handler.PayNoticeHandlerDistribute;
import com.focus.pay.core.handler.PayOrderHandlerDistribute;

public class ApiClient {

    /**
     * ********************支付********************
     * 支持：下单,订单查询,退款,退款查询,交易关闭,对账
     *
     * @param payAction 支付动作
     *                  L channelType       (支付渠道类型)
     *                  L method            (支付方法)
     *                  L model             (实体类)
     *                  L config            (支付参数)
     *                  L version           (版本)
     *                  L extension         (扩展字段)
     * @return 支付参数
     */
    public static <R> R payOrder(PayOrderAction payAction) {
        return PayOrderHandlerDistribute.action(payAction);
    }


    /**
     * ********************支付回调通知********************
     *
     * ***********************************************
     *
     * @param payNoticeAction 回调通知动作
     *                        L channel     (支付回调渠道)
     *                        L method      (回调类型)
     *                        L params      (回调参数)
     *                        L config      (支付参数)
     *                        L version     (版本)
     *                        L extension   (扩展字段)
     * @return 支付参数
     */
    public static <R> R payNotice(PayNoticeAction payNoticeAction) {
        return PayNoticeHandlerDistribute.action(payNoticeAction);
    }


}
